#include "SocketMatTransmissionServer.h"
 
int main()
{
	SocketMatTransmissionServer socketMat;
	if (socketMat.socketConnect(6666,0) < 0)
	{
		return 0;
	}
		
	 
	cv::Mat image;
	int res = 0;

	
	struct infohead head;
	res = socketMat.receive(head);
	socketMat.detectType=head.detectType;
	socketMat.width=head.width;
	socketMat.height=head.height;
	socketMat.packageNum=head.packageNum;
	
	
	while (1)
	{
		res = socketMat.receive(image);
		cout<< res<< endl;
		if(res > 0)
		{
			cv::imshow("receive",image);
			cv::waitKey(3);
			socketMat.send_res();
		}
		else
		{
			break;
		}
	}

	
 
	socketMat.socketDisconnect();
	
	return 0;
}